home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / pdc / include / stdio.h < prev    next >
C/C++ Source or Header  |  1990-04-05  |  3KB  |  89 lines

  1. /*
  2.  * Libraries and headers for PDC release 3.3 (C) 1989 Lionel Hummel.
  3.  * PDC Software Distribution (C) 1989 Lionel Hummel and Paul Petersen.
  4.  * PDC I/O Library (C) 1987 by J.A. Lydiatt.
  5.  *
  6.  * This code is freely redistributable upon the conditions that this 
  7.  * notice remains intact and that modified versions of this file not
  8.  * be included as part of the PDC Software Distribution without the
  9.  * express consent of the copyright holders.  No warrantee of any
  10.  * kind is provided with this code.  For further information, contact:
  11.  *
  12.  *  PDC Software Distribution    Internet:                     BIX:
  13.  *  P.O. Box 4006             or hummel@cs.uiuc.edu            lhummel
  14.  *  Urbana, IL  61801-8801       petersen@uicsrd.csrd.uiuc.edu
  15.  */
  16.  
  17. /*  stdio.h
  18. */
  19.  
  20. #ifndef STDIO_H
  21.  
  22. #ifndef NULL
  23. #define NULL    0L
  24. #endif
  25.  
  26. struct _iobuf {
  27.    struct _iobuf *next;            /* Link to next buffer in chain              */
  28.    int   _fileunit;             /* File descriptor                        */
  29.    char *_filecpos;        /* Current position in buffer          */
  30.    char *_fileend;        /* Last position in buffer          */
  31.    long  _filelen;        /* Buffer size                  */
  32.    char *_filebufp;               /* za buffer                              */
  33.    char  _filebyte;        /* Instant one-byte buffer                */
  34.    char  _padbyte;
  35.    unsigned short _fileflag;    /* Condition flags                        */
  36. };
  37.  
  38. #define FILE struct _iobuf
  39. extern FILE *_fdevtab[];
  40.  
  41. #define BUFSIZ          (1024)
  42. #define MAX_READ_SIZE    (1024)
  43.  
  44. #define _FILEACTIVE    0x01
  45. #define _FILEISDIRTY    0x02
  46. #define _FILEATEOF    0x04
  47. #define _FILEBAD    0x08
  48. #define _FILEISDYNA    0x10
  49. #define _FILEISTTY    0x20
  50.  
  51. #define _IOREAD         0x1
  52. #define _IOWRT          0x2
  53. #define _IOEOF          0x10
  54. #define _IOERR          0x20
  55. #define _IORW           0x100
  56.  
  57. #define EOF     (-1)
  58.     
  59. #define feof(p)         (((p)->_fileflag&_FILEATEOF)!=0)
  60. #define ferror(p)       (((p)->_fileflag&_FILEBAD)!=0)
  61. #define fileno(p)       ((p)->_fileunit)
  62. #define clearerr(p)     ((p)->_fileflag &= ~(_FILEBAD|_FILEATEOF))
  63.  
  64. #define getc(c)        fgetc((c))
  65. #define getchar()    fgetc(stdin)
  66. #define putc(c,s)    fputc((c),(s))
  67. #define putchar(c)    fputc((c), stdout)
  68.  
  69. extern FILE *stdin;
  70. extern FILE *stdout;
  71. extern FILE *stderr;
  72.  
  73. #if 0
  74. extern FILE *fopen(char *, char *);
  75. extern FILE *fdopen(int, char *);
  76. extern int   fgetc(FILE *);
  77. extern int   ungetc(char, FILE *);
  78. extern char *fgets(char *, int, FILE *);
  79. #else
  80. extern FILE *fopen();
  81. extern FILE *fdopen();
  82. extern int   fgetc();
  83. extern int   ungetc();
  84. extern char *fgets();
  85. #endif
  86.  
  87. #define STDIO_H
  88. #endif
  89.